<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-if指令</title>
</head>

<body>

    <div id="app">
        <input type="button" value="改变显示状态" @click="changeIsShow">
        <p v-if="isShow">这是v-if指令测试</p>
        <p v-show="isShow">这是v-show指令测试</p>
        <h3 v-if="tem>=40">热死了</h3>
    </div>

    <!-- 开发环境版本 -->
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        var app = new Vue({
            el: "#app",
            data: {
                isShow: false,
                tem: 45
            },
            methods: {
                changeIsShow: function () {
                    this.isShow = !this.isShow;
                }
            }
        })
    </script>
</body>

</html>